package com.chenchen.code.guava.io;

import com.google.common.io.BaseEncoding;
import org.junit.Test;

/**
 * @Description:
 * @author chenchen
 * @date 2019/5/13 10:20
 */
public class BaseEncodingTest {

    @Test
    public void testBase64Encode() {
        BaseEncoding baseEncoding = BaseEncoding.base64();
        System.out.println(baseEncoding.encode("hello".getBytes()));
        System.out.println(baseEncoding.encode("a".getBytes()));
    }

    @Test
    public void testBase64Decode() {
        BaseEncoding baseEncoding = BaseEncoding.base64();
        System.out.println(new String(baseEncoding.decode("aGVsbG8=")));
    }

}
